// qps
const QPS = require('./tools/qps');
let monitor = function (app) {
    setInterval(() => {
        let num = QPS.qps();
         if(num > 0){
             app.logger.defaultLogger.info(`qps:${num}`);
         }
    }, QPS);
    return async (ctx,next) => {
        QPS.inc();
        await next();
    }
};

module.exports = monitor;
